﻿
namespace System.Collections.Generic {
	public static class PaginationExtentions {
		public static PagedList<T> ToPagedList<T>(this IEnumerable<T> source, int pageSize = 10, int pageIndex = 0) {
			var list = new PagedList<T>(source);
			if (list.PageSize != pageSize) list.PageSize = pageSize;
			if (list.PageIndex != pageIndex) list.PageIndex = pageIndex;
			return list;
		}
	}
}
